<?php 

class App_trunks extends MY_Library {

function __construct()
{
	parent::__construct();

	$this->PACKAGE->routing->load->library('trunks/trunks');
}


public function enable_trunk($trunk_id,$trunk_type)
{
	// load required models
	$this->APPLICATION->load->model('app_mod_trunks');
	
	// other actions
	
	// change trunk status in database
	$result = $this->APPLICATION->app_mod_trunks->change_trunk_status($trunk_id, $trunk_type ,'1');
	
	return $result;
}

public function disable_trunk($trunk_id,$trunk_type)
{
	// load required models
	$this->APPLICATION->load->model('app_mod_trunks');
	
	// other actions
	
	// change trunk status in database
	$result = $this->APPLICATION->app_mod_trunks->change_trunk_status($trunk_id ,$trunk_type ,'0');
	
	return $result;
}

public function get_trunk_codecs($trunk_id,$trunk_type)
{
	$result = $this->PACKAGE->routing->trunks->get_trunk_codecs($trunk_id,$trunk_type);
	
	return $result;
}

public function get_trunk_ip_addresses($trunk_id,$trunk_type,$status = false)
{
	// load required models
	$this->APPLICATION->load->model('app_mod_trunks');

	$addresses = $this->APPLICATION->app_mod_trunks->get_trunk_ip_addresses($trunk_id ,$trunk_type,$status);
	
	return $addresses;
}

}
?>